﻿using System;
using System.Text.RegularExpressions;

namespace ValidatingEmail
{
    class ValidatingEmail
    {
        static void Main(string[] args)
        {
            string[] emails = { "Alabala@metroto", "Gor4iv0-j3l3zo@peshta.goreshta.unss", "Ivancho@mail.bg", "Kefche@maina.kenefa.com", "Ela_unas@kefche.bg", "Malka-brichka@yahoo.com" };
            string pattern = @"[\w\d]+[-_]?[\w\d]*@([\w\d]+\.)+[\w]{2,4}";
            foreach (var item in emails)
            {
                Match match = Regex.Match(item, pattern);
                while (match.Success)
                {
                    Console.WriteLine("Email: \"{0}\"", match);
                    match = match.NextMatch();
                }
            }
        }
    }
}